# Maintainer: Jeroen Hoekx <jeroen.hoekx AT hamok DOT be>
pkgname=rear-git
pkgver=20120614
pkgrel=1
pkgdesc="Linux Disaster Recovery"
arch=(any)
url="http://relax-and-recover.org/"
license=(GPL)
depends=(sysvinit-tools kbd cpio binutils ethtool gzip iputils parted tar openssl gawk attr bc syslinux rpcbind iproute2 nfs-utils libisoburn cdrtools util-linux psmisc procps-ng util-linux)
optdepends=( )
makedepends=(git asciidoctor)
provides=(rear)
backup=(etc/rear/local.conf)
source=()
md5sums=()

_gitroot=https://github.com/rear/rear.git
_gitname=rear

build() {
  cd "$srcdir"
  msg "Connecting to GIT server...."

  if [[ -d "$_gitname" ]]; then
    cd "$_gitname" && git pull origin
    msg "The local files are updated."
  else
    git clone "$_gitroot" "$_gitname"
  fi

  msg "GIT checkout done or server timeout"
  msg "Starting build..."

  rm -rf "$srcdir/$_gitname-build"
  git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
  cd "$srcdir/$_gitname-build"
}

package() {
  cd "$srcdir/$_gitname-build"
  make DESTDIR="$pkgdir/" install OFFICIAL=1
}

# vim:set ts=2 sw=2 et:
